********************************************************************************
********************************************************************************

* REPLICATION MATERIAL

* Hesstvedt & Christensen (2021) Political and administrative control of expert groups - a mixed methods study

* Accepted for publication in Governance February 24th 2021

* Code and data material uploaded 19.03.2021 to Harvard Dataverse

* Datasets employed: burctrl.dta & polctrl.dta & appendixdata.dta



********************************************************************************
********************************************************************************



* SECTION 5: DATA AND METHOD ***************************************************
* TABLE 1
* Number of commissions, secretaries and memnbers, in total and per ministry
clear 
use "burctrl.dta", replace
gen num_com=1
collapse (sum) num_com num_sec num_members, by(ministry)
by ministry: tab1 num_com num_members num_sec


* SECTION 7.1: POLITICAL CONTROL ***********************************************
* FIGURE 1
* Descriptive figures. Average number of reappointed academic per commission.
clear all
use polctrl.dta
collapse (sum) reapp_lr, by(NOU_ID)

graph bar reapp_lr , ///
ytitle("Average number per commission") ///
legend(order (1 "Reappointed academics: by both blocs" ///
2 "Reappointed academics: by one political bloc only")) ///
ylab(0(.2)1.4) 
graph save fig1_general_new.gph, replace

clear all
use polctrl.dta
collapse  ministry (sum) reapp_lr, by(NOU_ID)
collapse (mean) reapp_lr, by(ministry)
lab define labmin2 1"Finance" 2"Labor/social affairs" 3"Health" 4"Justice" 5"Commerce" 6"Education" 7"Culture"
lab value ministry labmin2

graph bar reapp_lr , by(ministry, note(" ")) ///
ytitle(" ") ylab(0(.2)1.4) ///
legend(order (1 "Reappointed academics: by both blocs" ///
2 "Reappointed academics: by one political bloc only"))
graph save fig1_ministry_aca.gph, replace

graph combine fig1_general_new.gph fig1_ministry_aca.gph



* FIGURE 2
* Vizualisation of regression results. The effect of policy portfolio on reappointmnet of experts, per ministry.
clear 
use polctrl.dta 
collapse com_yearsubmiss reapp_general fin asd helse kultur commerce edu jus ministry (sum) never_reapp left_right reapp_lr left_only right_only freq, by(NOU_ID)

statsby _b _se, saving(reapp_lr_fin, replace): nbreg reapp_lr  fin freq , r
statsby _b _se, saving(reapp_lr_kultur, replace): nbreg reapp_lr kultur freq, r
statsby _b _se, saving(reapp_lr_helse, replace): nbreg reapp_lr helse freq, r
statsby _b _se, saving(reapp_lr_commerce, replace): nbreg reapp_lr commerce freq, r
statsby _b _se, saving(reapp_lr_jus, replace): nbreg reapp_lr jus freq, r
statsby _b _se, saving(reapp_lr_edu, replace): nbreg reapp_lr edu freq, r
statsby _b _se, saving(reapp_lr_asd, replace): nbreg reapp_lr asd freq, r

clear all
use reapp_lr_fin
gen fin=1
rename reapp_lr_b_fin b_secall
rename reapp_lr_se_fin se_secall
keep fin b_secall se_secall
save reapp_lr_fin, replace

clear all
use reapp_lr_kultur
gen kultur=1
rename reapp_lr_b_kultur b_secall
rename reapp_lr_se_kultur se_secall
keep kultur b_secall se_secall
save reapp_lr_kultur, replace

clear all
use reapp_lr_helse
gen helse=1
rename reapp_lr_b_helse b_secall
rename reapp_lr_se_helse se_secall
keep helse b_secall se_secall
save reapp_lr_helse, replace

clear all
use reapp_lr_asd
gen asd=1
rename reapp_lr_b_asd b_secall
rename reapp_lr_se_asd se_secall
keep asd b_secall se_secall
save reapp_lr_asd, replace

clear all
use reapp_lr_edu
gen edu=1
rename reapp_lr_b_edu b_secall
rename reapp_lr_se_edu se_secall
keep edu b_secall se_secall
save reapp_lr_edu, replace

clear all
use reapp_lr_jus
gen jus=1
rename reapp_lr_b_jus b_secall
rename reapp_lr_se_jus se_secall
keep jus b_secall se_secall
save reapp_lr_jus, replace

clear all
use reapp_lr_commerce
gen commerce=1
rename reapp_lr_b_commerce b_secall
rename reapp_lr_se_commerce se_secall
keep commerce b_secall se_secall
save reapp_lr_commerce, replace

clear all
use reapp_lr_fin
append using reapp_lr_kultur
append using reapp_lr_helse
append using reapp_lr_asd
append using reapp_lr_jus
append using reapp_lr_commerce
append using reapp_lr_edu

gen ministry =0
replace ministry=1 if fin==1
replace ministry=2 if asd==1
replace ministry=3 if helse==1
replace ministry=4 if jus==1
replace ministry=5 if commerce==1
replace ministry=6 if edu==1
replace ministry=7 if kultur==1
recode ministry 0=.

lab define labminx 1"Finance" 2"Labour/social" 3"Health" 4"Justice" 5"Commerce" 6"Education" 7"Culture"
lab value ministry labminx

g ub = b_secall + (se_secall*1.645)
g lb = b_secall - (se_secall*1.645)

save reapp_lr.dta, replace
use reapp_lr.dta, replace

twoway (scatter b_secall ministry, ///
 ylabel(,angle(0) nogrid) title("") ///
 yline(0, lc(black) lp(dot)) ///
 ytitle("") xtitle("") msymbol(circle) ///
 legend(region(lwidth(none)))) ///
 (rscatter ub lb ministry, color(black) msymbol(pipe) msize(small) legend(off) ///
 xlab(1 "Finance" 2 "Labour/social" 3 "Health" 4 "Justice" 5 "Commerce" 6 "Education" 7 "Culture"))




* SECTION 7.2: BUREAUCRATIC CONTROL ********************************************
* FIGURE 3
* Descriptive figures. Average number of top civil servant or a secretary from the appointing ministry, per commission.
clear all
use "burctrl.dta", replace
collapse (sum) sec_samemin memb_rank, by(NOU_ID)

graph bar sec_samemin memb_rank , ///
ytitle("Average number per commission") ylab(0(1)3) ///
legend(order (1 "Secretariat: Appointing ministry" 2 "Members: Top civil servants" ) pos(6) col(2))
graph save civil_gen.gph, replace

clear all
use "burctrl.dta", replace
collapse ministry (sum) sec_samemin memb_rank, by(NOU_ID)
lab define labminx 1"Finance" 2"Labour/social affairs" 3"Health" 4"Justice" 5"Commerce" 6"Education" 7"Culture"
lab value ministry labminx

graph bar sec_samemin memb_rank, by(ministry, note(""))  ///
ytitle(" ", height(5)) ///
ylab(0(1)3, labsize(small)) ///
legend (order (1 "Secretariat: Appointing ministry" 2 "Members: Top civil servants" ) ///
pos(6) col(2)) 
graph save "civil_ministry.gph", replace

graph combine civil_gen.gph civil_ministry.gph



* FIGURE 4
* Vizualisation of regression results. The effect of ministries on bureaucratic control 1
* Dependent: Number of secretaries from appointing ministry
clear all
use "burctrl.dta", replace
statsby _b _se, saving(sec_samemin_fin, replace): nbreg sec_samemin  fin num_sec , r
statsby _b _se, saving(sec_samemin_asd, replace): nbreg sec_samemin  asd num_sec, r
statsby _b _se, saving(sec_samemin_kultur, replace): nbreg sec_samemin  kultur num_sec, r
statsby _b _se, saving(sec_samemin_helse, replace): nbreg sec_samemin  helse num_sec, r
statsby _b _se, saving(sec_samemin_jus, replace): nbreg sec_samemin  jus num_sec, r
statsby _b _se, saving(sec_samemin_commerce, replace): nbreg sec_samemin  commerce num_sec, r
statsby _b _se, saving(sec_samemin_edu, replace): nbreg sec_samemin  edu num_sec, r

clear all
use sec_samemin_fin
gen fin=1
rename sec_samemin_b_fin b_samemin
rename sec_samemin_se_fin se_samemin
keep fin b_samemin se_samemin
save sec_samemin_fin, replace

clear all
use sec_samemin_asd
gen asd=1
rename sec_samemin_b_asd b_samemin
rename sec_samemin_se_asd se_samemin
keep asd b_samemin se_samemin
save sec_samemin_asd, replace

clear all
use sec_samemin_kultur
gen kultur=1
rename sec_samemin_b_kultur b_samemin
rename sec_samemin_se_kultur se_samemin
keep kultur b_samemin se_samemin
save sec_samemin_kultur, replace

clear all
use sec_samemin_helse
gen helse=1
rename sec_samemin_b_helse b_samemin
rename sec_samemin_se_helse se_samemin
keep helse b_samemin se_samemin
save sec_samemin_helse, replace

clear all
use sec_samemin_jus
gen jus=1
rename sec_samemin_b_jus b_samemin
rename sec_samemin_se_jus se_samemin
keep jus b_samemin se_samemin
save sec_samemin_jus, replace

clear all
use sec_samemin_commerce
gen commerce=1
rename sec_samemin_b_commerce b_samemin
rename sec_samemin_se_commerce se_samemin
keep commerce b_samemin se_samemin
save sec_samemin_commerce, replace

clear all
use sec_samemin_edu
gen edu=1
rename sec_samemin_b_edu b_samemin
rename sec_samemin_se_edu se_samemin
keep edu b_samemin se_samemin
save sec_samemin_edu, replace

clear all
use sec_samemin_fin
append using sec_samemin_kultur
append using sec_samemin_helse
append using sec_samemin_edu
append using sec_samemin_jus
append using sec_samemin_commerce
append using sec_samemin_asd

gen ministry =0
replace ministry=1 if fin==1
replace ministry=2 if asd==1
replace ministry=3 if helse==1
replace ministry=4 if jus==1
replace ministry=5 if commerce==1
replace ministry=6 if edu==1
replace ministry=7 if kultur==1
recode ministry 0=.

lab define labmin 1"Finance" 2"Labour/social" 3"Health" 4"Justice" 5"Commerce" 6"Education" 7"Culture"
lab value ministry labmin

g ub = b_samemin + (se_samemin*1.645)
g lb = b_samemin - (se_samemin*1.645)

save sec_samemin.dta, replace

use sec_samemin.dta, replace
twoway (scatter b_samemin ministry, ///
 ylabel(,angle(0) nogrid) title("") ///
 yline(0, lc(black) lp(dot)) ///
 ytitle("") xtitle("") msymbol(circle) ///
 legend(region(lwidth(none)))) ///
 (rscatter ub lb ministry, color(black) msymbol(pipe) msize(small) legend(off) ///
 xlab(1 "Finance" 2 "Labour/social" 3 "Health" 4 "Justice" 5 "Commerce" 6 "Education" 7 "Culture"))
graph save  "samemin.gph", replace
graph export  "samemin.pdf", as(pdf) replace



* FIGURE 5
* Vizualisation of regression results. The effect of ministries on bureaucratic control 2
* Dependent: Number of top civil servants on commission
clear all
use "burctrl.dta", replace
statsby _b _se, saving(memb_rank_fin, replace): nbreg memb_rank  fin num_members , r
statsby _b _se, saving(memb_rank_asd, replace): nbreg memb_rank  asd num_members , r
statsby _b _se, saving(memb_rank_kultur, replace): nbreg memb_rank  kultur num_members , r
statsby _b _se, saving(memb_rank_helse, replace): nbreg memb_rank  helse num_members , r
statsby _b _se, saving(memb_rank_jus, replace): nbreg memb_rank  jus num_members , r
statsby _b _se, saving(memb_rank_commerce, replace): nbreg memb_rank  commerce num_members , r
statsby _b _se, saving(memb_rank_edu, replace): nbreg memb_rank  edu num_members , r

clear all
use memb_rank_fin
gen fin=1
rename memb_rank_b_fin b_membrank
rename memb_rank_se_fin se_membrank
keep fin b_membrank se_membrank
save memb_rank_fin, replace

clear all
use memb_rank_asd
gen asd=1
rename memb_rank_b_asd b_membrank
rename memb_rank_se_asd se_membrank
keep asd b_membrank se_membrank
save memb_rank_asd, replace

clear all
use memb_rank_kultur
gen kultur=1
rename memb_rank_b_kultur b_membrank
rename memb_rank_se_kultur se_membrank
keep kultur b_membrank se_membrank
save memb_rank_kultur, replace

clear all
use memb_rank_helse
gen helse=1
rename memb_rank_b_helse b_membrank
rename memb_rank_se_helse se_membrank
keep helse b_membrank se_membrank
save memb_rank_helse, replace

clear all
use memb_rank_jus
gen jus=1
rename memb_rank_b_jus b_membrank
rename memb_rank_se_jus se_membrank
keep jus b_membrank se_membrank
save memb_rank_jus, replace

clear all
use memb_rank_commerce
gen commerce=1
rename memb_rank_b_commerce b_membrank
rename memb_rank_se_commerce se_membrank
keep commerce b_membrank se_membrank
save memb_rank_commerce, replace

clear all
use memb_rank_edu
gen edu=1
rename memb_rank_b_edu b_membrank
rename memb_rank_se_edu se_membrank
keep edu b_membrank se_membrank
save memb_rank_edu, replace

clear all
use memb_rank_fin
append using memb_rank_kultur
append using memb_rank_helse
append using memb_rank_edu
append using memb_rank_jus
append using memb_rank_commerce
append using memb_rank_asd

gen ministry =0
replace ministry=1 if fin==1
replace ministry=2 if asd==1
replace ministry=3 if helse==1
replace ministry=4 if jus==1
replace ministry=5 if commerce==1
replace ministry=6 if edu==1
replace ministry=7 if kultur==1
recode ministry 0=.

lab define labmin 1"Finance" 2"Labour/social" 3"Health" 4"Justice" 5"Commerce" 6"Education" 7"Culture"
lab value ministry labmin

g ub = b_membrank + (se_membrank*1.645)
g lb = b_membrank - (se_membrank*1.645)

save memb_rank.dta, replace
use memb_rank.dta, replace
twoway (scatter b_membrank ministry, ///
 ylabel(,angle(0) nogrid) title("") ///
 yline(0, lc(black) lp(dot)) ///
 ytitle("") xtitle("") msymbol(circle) ///
 legend(region(lwidth(none)))) ///
 (rscatter ub lb ministry, color(black) msymbol(pipe) msize(small) legend(off) ///
 xlab(1 "Finance" 2 "Labour/social" 3 "Health" 4 "Justice" 5 "Commerce" 6 "Education" 7 "Culture"))
graph save  "samemin.gph", replace
graph export  "samemin.pdf", as(pdf) replace




* APPENDIX *********************************************************************

* TABLE A1
* Total numbers of members, secretaries, and chairpersons, by affiliation
clear
use appendixdata.dta
*Chairpersons - affiliation
tab1 no_leader d_aca_l d_civil_l d_pubempl_l d_ig_l d_priv_l d_judge_l d_lawcons_l d_polit_l d_others_l
*Members - affiliation
tab1 num_members num_aca num_civil num_pubempl num_ig num_priv num_judge num_lawcons num_polit num_others
*Secretaries - affiliation 
tab1 num_sec num_aca_sec num_civil_sec num_pubempl_sec num_ig_sec num_priv_sec num_judge_sec num_lawcons_sec num_polit_sec num_others_sec


* TABLE A2
* Descriptive statistics for variables in regression analyses. N = commissions.
clear 
use polctrl.dta 
collapse com_yearsubmiss reapp_general fin asd helse kultur commerce edu jus ministry (sum) never_reapp left_right reapp_lr left_only right_only freq, by(NOU_ID)
sum reapp_lr freq asd fin helse kultur jus commerce edu

clear 
use burctrl.dta
sum sec_same memb_rank num_sec num_members asd fin helse kultur jus commerce edu


* TABLE A3
* Regression results for Figure 2 (policy portfolio and political control)
clear 
use polctrl.dta 
collapse com_yearsubmiss reapp_general fin asd helse kultur commerce edu jus ministry (sum) never_reapp left_right reapp_lr left_only right_only freq, by(NOU_ID)
nbreg reapp_lr  fin  freq, r
estimates store r1
nbreg reapp_lr kultur freq , r
estimates store r2 
nbreg reapp_lr helse freq , r
estimates store r3
nbreg reapp_lr jus freq , r
estimates store r4
nbreg reapp_lr edu freq , r
estimates store r5
nbreg reapp_lr asd freq , r
estimates store r6 
nbreg reapp_lr commerce freq , r
estimates store r7

esttab r1 r2 r3 r4 r5 r6 r7 using ///
"C:\Users\stinhess.UIO\Dropbox\Dokumenter\Paagaaende\EUREX\Data_analyses\Mixedmethods\Governance_final\TableA3.rtf", ///
label nogaps se star(* 0.10 ** 0.05 *** 0.01) title("Main models")  b(3) stats(N)  replace


* TABLE  A4
* Regression results for Figure 4 (ministry and bureaucratic control)
* Dependent: Secretary from appointing ministry
clear all
use "burctrl.dta", replace
nbreg sec_samemin  fin num_sec, r
estimates store s1
nbreg sec_samemin  asd num_sec, r
estimates store s2
nbreg sec_samemin  helse num_sec, r
estimates store s3
nbreg sec_samemin  jus num_sec, r
estimates store s4
nbreg sec_samemin  commerce num_sec, r
estimates store s5
nbreg sec_samemin  edu num_sec, r
estimates store s6
nbreg sec_samemin  kultur num_sec, r
estimates store s7

esttab s1 s2 s3 s4 s5 s6 s7 using ///
"C:\Users\stinhess.UIO\Dropbox\Dokumenter\Paagaaende\EUREX\Data_analyses\Mixedmethods\\Governance_final\TableA4.rtf".rtf", ///
label nogaps se star(* 0.10 ** 0.05 *** 0.01) title("Main models")  b(3) stats(N)  replace



* TABLE A5
* Regression results for Figure 5 (ministry and bureaucratic control)
* Dependent: Top civil servant
clear all
use "burctrl.dta", replace

nbreg memb_rank  fin num_members , r
estimates store m1
nbreg memb_rank  asd num_members , r
estimates store m2
nbreg memb_rank  helse num_members , r
estimates store m3
nbreg memb_rank  jus num_members , r
estimates store m4
nbreg memb_rank  commerce num_members , r
estimates store m5
nbreg memb_rank  edu num_members , r
estimates store m6
nbreg memb_rank  kultur num_members , r
estimates store m7

esttab m1 m2 m3 m4 m5 m6 m7 using ///
"C:\Users\stinhess.UIO\Dropbox\Dokumenter\Paagaaende\EUREX\Data_analyses\Mixedmethods\Figures\FINAL\TableA5.rtf", ///
label nogaps se star(* 0.10 ** 0.05 *** 0.01) title("Main models")  b(3) stats(N)  replace



* TABLE A5
* Effect of academic share on bureaucratic control 
* Dependent: Secretary from appointing ministry
clear 
use "appendixdata.dta", replace

*Same ministry
nbreg sec_samemin perc_aca  num_sec , r
estimates store s1

esttab s1 using ///
"C:\Users\stinhess.UIO\Dropbox\Dokumenter\1. Prosjekter\1. EUREX og phd\Data_analyses\Mixedmethods\Figures\FINAL\Appendix_share_samemin.rtf", ///
label nogaps se star(* 0.10 ** 0.05 *** 0.01) title("Main models")  b(3) stats(N)  replace















